package com.cwj.user.controller;

import com.cwj.common.domain.user;
import com.cwj.common.vo.Result;
import com.cwj.common.vo.user.welcomeVo;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/welcome")
public class welcomeController {
    @Resource
    private com.cwj.user.service.welcome welcome;
    @Resource
    HttpServletRequest request;
    @PostMapping("/GetMessage")
    private Result GetMessage(welcomeVo welcomeVo) throws JsonProcessingException {
        user user = new user();
        BeanUtils.copyProperties(welcomeVo,user);
        Map<String, Object> map = welcome.GetMessage(user);
        return Result.normal(map,null);
    }
    @PostMapping("/GetMessageBySql")
    private Result GetMessageBySql(welcomeVo welcomeVo){
        user user = new user();
        BeanUtils.copyProperties(welcomeVo,user);
        return null;
    }
}
